import type { goodsItem, pageResult } from '@/types/global'
import type { bannerItem, categoryItem, hotItem } from '@/types/home'
import { request } from '@/utils/request'

/**
 * 轮播图
 * @param data
 * @returns
 */
export const getBannerApi = (data: any) => {
  return request<bannerItem[]>({
    method: 'GET',
    url: '/home/banner',
    data,
  })
}

/**
 * 前台分类
 * @param data
 * @returns
 */
export const getCategoryApi = (data: any) => {
  return request<categoryItem[]>({
    method: 'GET',
    url: '/home/category/mutli',
    data,
  })
}

/**
 * 热门推荐
 * @param data
 * @returns
 */
export const getHotApi = (data: any) => {
  return request<hotItem[]>({
    method: 'GET',
    url: '/home/hot/mutli',
    data,
  })
}

/**
 * 猜你喜欢
 * @param data
 * @returns
 */
export const getGuessLikeApi = (data: any) => {
  return request<pageResult<goodsItem>>({
    method: 'GET',
    url: '/home/goods/guessLike',
    data,
  })
}
